package artid.com.arttogoa;

import artid.com.arttogoa.R;

import artid.com.arttogoa.util.AppUtil;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

/**
 * 
 *    
 * 项目名称：ArtworkArtA   
 * 类名称   ：MyWallet_Activity   
 * 类描述   ：我的钱包   
 * 创建人   ：耿卫斌   
 * 创建时间：2016-7-19 下午2:57:02   
 *
 */
public class MyWallet_Activity extends BaseActivity implements OnClickListener{
	private Context mContext;
	private RelativeLayout withdrawalsRL;
	private TextView money_tv;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_mywallet);
		setContent(this, getIntent());
		mContext=MyWallet_Activity.this;
		initView();
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		money_tv.setText("￥"+AppUtil.getUser().getAvailable_predeposit());
	}

	private void initView(){
		mTittle.setText("我出钱包");
		setBack();
		ImageView titleRight_img=(ImageView) findViewById(R.id.release_icon);
		titleRight_img.setVisibility(View.VISIBLE);
		titleRight_img.setOnClickListener(this);
		titleRight_img.setImageResource(R.drawable.money_btn_zhangdan);
		withdrawalsRL=(RelativeLayout) findViewById(R.id.mywallet_withdrawalsRL);
		withdrawalsRL.setOnClickListener(this);
		money_tv=(TextView) findViewById(R.id.mywallet_money);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.release_icon:
			//账单
			Intent i2=new Intent(mContext,TransactionRecord_Activity.class);
			startActivity(i2);
			break;
		case R.id.mywallet_withdrawalsRL:
			//提现
			Intent i=new Intent(mContext,Withdrawals_Activity.class);
			i.putExtra("price", AppUtil.getUser().getAvailable_predeposit());
			startActivity(i);
			break;
		default:
			break;
		}
	}
}
